﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>列表的排序过渡</title>
</head>
<body>
<script src="lodash.js"></script>
<style>
        .flip-list-move {
            transition: transform 1s;
        }
    </style>
<div id="app" class="demo">
    <button v-on:click="shuffle">排序过渡</button>
    <transition-group name="flip-list" tag="ul">
        <li v-for="item in items" v-bind:key="item">
            {{ item }}
        </li>
    </transition-group>
</div>

<!--引入vue文件-->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    //创建一个应用程序实例
    const vm= Vue.createApp({
        //该函数返回数据对象
        data(){
          return{
             items: [10,20,30,40,50,60,70,80,90],
            nextNum: 10
           }
        },
        methods: {
            shuffle: function () {
                this.items = _.shuffle(this.items)
            }
        }
     //在指定的DOM元素上装载应用程序实例的根组件
     }).mount('#app');
</script>
</body>
</html>
